package com.example.mybatisplus.coll;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.mybatisplus.entity.Xinxi;
import com.example.mybatisplus.servlic.XinXiServlic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class Coll {

    @Autowired
    XinXiServlic xinXiServlic;

    @RequestMapping("selall")
    @ResponseBody
    public  IPage aa(){
//        QueryWrapper queryWrapper = new QueryWrapper();
//        queryWrapper.eq("name","陈子嘉");
//        List<Xinxi> list = xinXiServlic.list(queryWrapper);
        Page<Xinxi> page = new Page<>(2,1);
        IPage<Xinxi> page1 = xinXiServlic.page(page, null);
//        for (Xinxi li:list){
//            System.out.println(li);
//        }
        return  page1;
    }
}
